package com.e2oto.seller.common.base;

import android.os.Bundle;


/**
 * Created by ZhangLiQiang on 2017/8/5.
 */

public abstract class BaseMvpActivity<V,T extends BasePresenter<V>> extends BaseActivity {

    protected T mPresenter;


    @Override
    protected void afterView(Bundle savedInstanceState) {
        mPresenter=createPresenter();//创建presenter
        mPresenter.attachView((V)this);

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if(mPresenter!=null){
            mPresenter.detachView();
        }
    }


    protected abstract T createPresenter();
}